<!DOCTYPE html>
#parse("header.html")
<html lang="zh">
<head>
    <meta charset="utf-8">
    <title>Blog</title>
    <link href="/static/css/editormd.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
   <div class="box col-md-12">
        <h1>${article.title}</h1>
       #if($tags.size() > 0)
       tags:
        #foreach($tag in $tags)
            ${tag.name}
        #end
       #end
        <div id="doc-content">
            <textarea style="display:none;">${article.content}</textarea>
        </div>

       <div>
           <button  id="like" onclick="like();" class="btn glyphicon glyphicon-thumbs-up">
               <span id="like_count" ></span>
           </button>
       </div>
   </div>

</div>
<script src="/static/js/jquery-1.11.1.min.js"></script>
<script src="/static/js/editormd.min.js"></script>
<script src="/static/js/marked.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        htmlobj=$.ajax({url:"/like/get/$article.id",async:false});
        $("#like_count").html(htmlobj.responseText);
    });

    var testEditor;
    $(function () {
        testEditor = editormd.markdownToHTML("doc-content", {
            htmlDecode: "style,script,iframe",
            emoji: true,
            taskList: true,
            tex: true, // 默认不解析
            flowChart: true, // 默认不解析
            sequenceDiagram: true, // 默认不解析
            codeFold: true,
    });});

    function like(){
        htmlobj=$.ajax({url:"/like/add/$article.id",async:false});
        $("#like").attr({disabled:"disabled"});
        $("#like_count").html(htmlobj.responseText);
    }

 </script>
</body>
#parse("footer.html")
